package com.atguigu.juc.volatiles;

/**
 * @author yfstart
 * @create 2022-07-19 20:51
 */
public class SingletonDemo {
  private SingletonDemo() {}

  // 现在比较好的做法就是采用静态内部内的方式实现
  private static class SingletonDemoHandler {
    private static SingletonDemo instance = new SingletonDemo();
  }

  public static SingletonDemo getInstance() {
    return SingletonDemoHandler.instance;
  }
}
